<html>
<head><meta charset="utf-8"><title>Looking into ARMv8.3/arm64e support for rustc. · t-compiler/wg-llvm · Zulip Chat Archive</title></head>
<h2>Stream: <a href="https://rust-lang.github.io/zulip_archive/stream/187780-t-compiler/wg-llvm/index.html">t-compiler/wg-llvm</a></h2>
<h3>Topic: <a href="https://rust-lang.github.io/zulip_archive/stream/187780-t-compiler/wg-llvm/topic/Looking.20into.20ARMv8.2E3.2Farm64e.20support.20for.20rustc.2E.html">Looking into ARMv8.3/arm64e support for rustc.</a></h3>

<hr>

<base href="https://rust-lang.zulipchat.com">

<head><link href="https://rust-lang.github.io/zulip_archive/style.css" rel="stylesheet"></head>

<a name="201648604"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/187780-t-compiler/wg-llvm/topic/Looking%20into%20ARMv8.3/arm64e%20support%20for%20rustc./near/201648604" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> aspen <a href="https://rust-lang.github.io/zulip_archive/stream/187780-t-compiler/wg-llvm/topic/Looking.20into.20ARMv8.2E3.2Farm64e.20support.20for.20rustc.2E.html#201648604">(Jun 22 2020 at 19:15)</a>:</h4>
<p>Hello, I was told that this was the right stream to ask questions about how I would accomplish this.</p>
<p>I'm looking to allow rustc to target ARMv8.3+ targets with support for Pointer Authentication. A quick and dirty glance shows that the latest branch of rust's LLVM supports these options, and I was wondering how I could teach the Rust compiler to use these LLVM options properly.</p>



<a name="201673106"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/187780-t-compiler/wg-llvm/topic/Looking%20into%20ARMv8.3/arm64e%20support%20for%20rustc./near/201673106" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Amanieu <a href="https://rust-lang.github.io/zulip_archive/stream/187780-t-compiler/wg-llvm/topic/Looking.20into.20ARMv8.2E3.2Farm64e.20support.20for.20rustc.2E.html#201673106">(Jun 22 2020 at 23:24)</a>:</h4>
<p>A good first step would be to look at how Clang does it. Is it just a matter of enabling a target feature? Or does the front-end need to do some additional work?</p>



<a name="201673305"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/187780-t-compiler/wg-llvm/topic/Looking%20into%20ARMv8.3/arm64e%20support%20for%20rustc./near/201673305" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> aspen <a href="https://rust-lang.github.io/zulip_archive/stream/187780-t-compiler/wg-llvm/topic/Looking.20into.20ARMv8.2E3.2Farm64e.20support.20for.20rustc.2E.html#201673305">(Jun 22 2020 at 23:27)</a>:</h4>
<p><span class="user-mention silent" data-user-id="143274">Amanieu</span> <a href="#narrow/stream/187780-t-compiler.2Fwg-llvm/topic/Looking.20into.20ARMv8.2E3.2Farm64e.20support.20for.20rustc.2E/near/201673106">said</a>:</p>
<blockquote>
<p>A good first step would be to look at how Clang does it. Is it just a matter of enabling a target feature? Or does the front-end need to do some additional work?</p>
</blockquote>
<p>I believe it's <code>-march=armv8.3-a</code></p>



<a name="201673315"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/187780-t-compiler/wg-llvm/topic/Looking%20into%20ARMv8.3/arm64e%20support%20for%20rustc./near/201673315" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> aspen <a href="https://rust-lang.github.io/zulip_archive/stream/187780-t-compiler/wg-llvm/topic/Looking.20into.20ARMv8.2E3.2Farm64e.20support.20for.20rustc.2E.html#201673315">(Jun 22 2020 at 23:27)</a>:</h4>
<p>Or <code>-march=armv8.5-a</code> and so on</p>



<a name="201712770"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/187780-t-compiler/wg-llvm/topic/Looking%20into%20ARMv8.3/arm64e%20support%20for%20rustc./near/201712770" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Amanieu <a href="https://rust-lang.github.io/zulip_archive/stream/187780-t-compiler/wg-llvm/topic/Looking.20into.20ARMv8.2E3.2Farm64e.20support.20for.20rustc.2E.html#201712770">(Jun 23 2020 at 11:18)</a>:</h4>
<p>I think you can just enable the relevant feature with <code>-C target-feature=+&lt;feature&gt;</code></p>



<a name="201712805"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/187780-t-compiler/wg-llvm/topic/Looking%20into%20ARMv8.3/arm64e%20support%20for%20rustc./near/201712805" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Amanieu <a href="https://rust-lang.github.io/zulip_archive/stream/187780-t-compiler/wg-llvm/topic/Looking.20into.20ARMv8.2E3.2Farm64e.20support.20for.20rustc.2E.html#201712805">(Jun 23 2020 at 11:18)</a>:</h4>
<p>You can get the list of target feature supported by LLVM with <code>llc -march=aarch64 -mattr=help</code></p>



<a name="202002049"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/187780-t-compiler/wg-llvm/topic/Looking%20into%20ARMv8.3/arm64e%20support%20for%20rustc./near/202002049" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> aspen <a href="https://rust-lang.github.io/zulip_archive/stream/187780-t-compiler/wg-llvm/topic/Looking.20into.20ARMv8.2E3.2Farm64e.20support.20for.20rustc.2E.html#202002049">(Jun 25 2020 at 17:51)</a>:</h4>
<p>actually does upstream LLVM even support Pointer Authentication yet?</p>



<a name="202002537"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/187780-t-compiler/wg-llvm/topic/Looking%20into%20ARMv8.3/arm64e%20support%20for%20rustc./near/202002537" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Hanna Kruppe <a href="https://rust-lang.github.io/zulip_archive/stream/187780-t-compiler/wg-llvm/topic/Looking.20into.20ARMv8.2E3.2Farm64e.20support.20for.20rustc.2E.html#202002537">(Jun 25 2020 at 17:54)</a>:</h4>
<p>At a glance, it doesn't look like it. There was an RFC about upstreaming it last October (<a href="http://lists.llvm.org/pipermail/llvm-dev/2019-October/136091.html">http://lists.llvm.org/pipermail/llvm-dev/2019-October/136091.html</a>) but nothing since when as far as I can tell.</p>



<a name="202740829"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/187780-t-compiler/wg-llvm/topic/Looking%20into%20ARMv8.3/arm64e%20support%20for%20rustc./near/202740829" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> aspen <a href="https://rust-lang.github.io/zulip_archive/stream/187780-t-compiler/wg-llvm/topic/Looking.20into.20ARMv8.2E3.2Farm64e.20support.20for.20rustc.2E.html#202740829">(Jul 02 2020 at 20:25)</a>:</h4>
<p>Hm, how will Rust support Apple Silicon-based macs then? Chances are they'll be ARMv8.3 or ARMv8.5.</p>



<a name="202854024"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/187780-t-compiler/wg-llvm/topic/Looking%20into%20ARMv8.3/arm64e%20support%20for%20rustc./near/202854024" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> aspen <a href="https://rust-lang.github.io/zulip_archive/stream/187780-t-compiler/wg-llvm/topic/Looking.20into.20ARMv8.2E3.2Farm64e.20support.20for.20rustc.2E.html#202854024">(Jul 04 2020 at 03:32)</a>:</h4>
<p>Would it be possible to merge Apple's LLVM changes into the Rust LLVM fork?</p>



<a name="202863649"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/187780-t-compiler/wg-llvm/topic/Looking%20into%20ARMv8.3/arm64e%20support%20for%20rustc./near/202863649" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Nikita Popov <a href="https://rust-lang.github.io/zulip_archive/stream/187780-t-compiler/wg-llvm/topic/Looking.20into.20ARMv8.2E3.2Farm64e.20support.20for.20rustc.2E.html#202863649">(Jul 04 2020 at 08:27)</a>:</h4>
<p>The patches need to be approved upstream first.</p>



<a name="202863697"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/187780-t-compiler/wg-llvm/topic/Looking%20into%20ARMv8.3/arm64e%20support%20for%20rustc./near/202863697" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Nikita Popov <a href="https://rust-lang.github.io/zulip_archive/stream/187780-t-compiler/wg-llvm/topic/Looking.20into.20ARMv8.2E3.2Farm64e.20support.20for.20rustc.2E.html#202863697">(Jul 04 2020 at 08:28)</a>:</h4>
<p>Apple want to upstream the changes in their fork and the legalities are currently being resolved, but from what I understood the actual upstreaming will require community contribution. I.e. someone has to take the relevant changes from their fork, break them down into reasonable parts and push them through code review.</p>



<a name="203104255"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/187780-t-compiler/wg-llvm/topic/Looking%20into%20ARMv8.3/arm64e%20support%20for%20rustc./near/203104255" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nagisa <a href="https://rust-lang.github.io/zulip_archive/stream/187780-t-compiler/wg-llvm/topic/Looking.20into.20ARMv8.2E3.2Farm64e.20support.20for.20rustc.2E.html#203104255">(Jul 07 2020 at 13:47)</a>:</h4>
<p><span class="user-mention silent" data-user-id="312033">aspen</span> <a href="#narrow/stream/187780-t-compiler.2Fwg-llvm/topic/Looking.20into.20ARMv8.2E3.2Farm64e.20support.20for.20rustc.2E/near/202740829">said</a>:</p>
<blockquote>
<p>Hm, how will Rust support Apple Silicon-based macs then? Chances are they'll be ARMv8.3 or ARMv8.5.</p>
</blockquote>
<p>Its not like those chips won’t be able to execute ARMv8.2 machine code… right? What makes you so insistent on v8.3/8.5 insns being required?</p>



<a name="203106930"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/187780-t-compiler/wg-llvm/topic/Looking%20into%20ARMv8.3/arm64e%20support%20for%20rustc./near/203106930" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jake Goulding <a href="https://rust-lang.github.io/zulip_archive/stream/187780-t-compiler/wg-llvm/topic/Looking.20into.20ARMv8.2E3.2Farm64e.20support.20for.20rustc.2E.html#203106930">(Jul 07 2020 at 14:08)</a>:</h4>
<p>Note that a lot of discussion has occurred in <a class="stream" data-stream-id="242906" href="/#narrow/stream/242906-t-compiler.2Farm">#t-compiler/arm</a>. This is probably most relevant:</p>
<p><a href="https://twitter.com/jckarter/status/1280211570182615040">https://twitter.com/jckarter/status/1280211570182615040</a></p>
<p><a href="https://twitter.com/jckarter/status/1280209930885017600">https://twitter.com/jckarter/status/1280209930885017600</a></p>
<div class="inline-preview-twitter"><div class="twitter-tweet"><a href="https://twitter.com/jckarter/status/1280211570182615040"><img class="twitter-avatar" src="https://pbs.twimg.com/profile_images/1251258044106723328/O5MSYSy-_normal.jpg"></a><p><a href="https://twitter.com/JakeGoulding">@JakeGoulding</a> <a href="https://twitter.com/luxx4x">@luxx4x</a> <a href="https://twitter.com/indirect">@indirect</a> Yeah, non-system binaries should still only be arm64 for the time being</p><span>- Joe Groff (@jckarter)</span></div></div><div class="inline-preview-twitter"><div class="twitter-tweet"><a href="https://twitter.com/jckarter/status/1280209930885017600"><img class="twitter-avatar" src="https://pbs.twimg.com/profile_images/1251258044106723328/O5MSYSy-_normal.jpg"></a><p><a href="https://twitter.com/JakeGoulding">@JakeGoulding</a> <a href="https://twitter.com/luxx4x">@luxx4x</a> <a href="https://twitter.com/indirect">@indirect</a> I think it'd still be more frustrating than rewarding right now to try to chase arm64e support to interop with Apple C/Swift ABIs right now, since they're still in flux. It could be interesting to mess with to starting working out a good ptrauth ABI for rust though</p><span>- Joe Groff (@jckarter)</span></div></div>



<hr><p>Last updated: Aug 07 2021 at 22:04 UTC</p>
</html>